<template>
	<view>
		<view class="content">
			<studyList listType="1" :list="list"></studyList>
		</view>
	</view>
</template>

<script>
	// +----------------------------------------------------------------------
	// |万岳科技开源系统 [山东万岳信息科技有限公司]
	// +----------------------------------------------------------------------
	// | Copyright (c) 2020~2022 https://www.sdwanyue.com All rights reserved.
	// +----------------------------------------------------------------------
	// | 万岳科技相关开源系统代码并不是自由软件，未经授权许可不能去掉wanyue【万岳科技】相关版权并商用
	// +----------------------------------------------------------------------
	// | Author: 万岳科技开源官方 < wanyuekj2020@163.com >
	// +----------------------------------------------------------------------
	import studyList from '@/components/study-list/study-list.vue';
	import request from '@/util/request.js';
	const app = getApp();
	export default {
		components:{
			studyList
		},
		data() {
			return {
				list:[],
				page:1,
				isBottom:false,//有没有到底部
			}
		},
		onLoad(){
			var url = app.globalData.site_url+'/appapi/?s=Home.DanghistoryList';
			request.requestApi(url,{}).then(res=>{
				this.list = res.data.info[0];
			})
		},
		onReachBottom(){
			var _this = this;
			if(this.isBottom==true){
				uni.showToast({
					title:'已经到底部了',
					icon:'none'
				})
				return ;
			}
			var p = this.page+1;
			this.page = p;
			
			var url1 = app.globalData.site_url + '/appapi/?s=Home.DanghistoryList';
			request.requestApi(url1,{p:p}).then(res1=>{
				if(res1.data.info[0].length<10){
					_this.isBottom = true;
				}
				var list = this.list;
				for(var i=0;i<res1.data.info[0].length;i++){
					list.push(res1.data.info[0]);
				}
				this.list = list;
			})
		},
		methods: {
			
		}
	}
</script>

<style>
	.content{
		width: 94%;
		margin: 0 auto;
	}
</style>
